// 跳跃游戏
/**
 * @param {number[]} nums
 * @return {number}
 */
 var jump = function(nums) {
    let n = nums.length;
    let cover = nums[0];
    let count = 0;
    let flag = 0;
    for(let i = 0; i < n-1; i++) {
      cover = Math.max(cover,i+nums[i])
      if(i == flag) {
          flag = cover;
          count++
      }
    }
    return count;
 };